package com.ruoyi.project.system.interact.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.interact.mapper.OathMapper;
import com.ruoyi.project.system.interact.domain.Oath;
import com.ruoyi.project.system.interact.service.IOathService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 入党宣誓Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-15
 */
@Service
public class OathServiceImpl implements IOathService 
{
    @Autowired
    private OathMapper oathMapper;

    /**
     * 查询入党宣誓
     * 
     * @param id 入党宣誓ID
     * @return 入党宣誓
     */
    @Override
    public Oath selectOathById(Long id)
    {
        return oathMapper.selectOathById(id);
    }

    /**
     * 查询入党宣誓列表
     * 
     * @param oath 入党宣誓
     * @return 入党宣誓
     */
    @Override
    public List<Oath> selectOathList(Oath oath)
    {
        return oathMapper.selectOathList(oath);
    }

    /**
     * 新增入党宣誓
     * 
     * @param oath 入党宣誓
     * @return 结果
     */
    @Override
    public int insertOath(Oath oath)
    {
        oath.setCreateTime(DateUtils.getNowDate());
        return oathMapper.insertOath(oath);
    }

    /**
     * 修改入党宣誓
     * 
     * @param oath 入党宣誓
     * @return 结果
     */
    @Override
    public int updateOath(Oath oath)
    {
        oath.setUpdateTime(DateUtils.getNowDate());
        return oathMapper.updateOath(oath);
    }

    /**
     * 删除入党宣誓对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteOathByIds(String ids)
    {
        return oathMapper.deleteOathByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除入党宣誓信息
     * 
     * @param id 入党宣誓ID
     * @return 结果
     */
    @Override
    public int deleteOathById(Long id)
    {
        return oathMapper.deleteOathById(id);
    }
} 